# $Id: PKGBUILD 150380 2012-02-17 10:25:47Z allan $
#Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=xorg-fonts-misc
pkgver=1.0.1
pkgrel=2
pkgdesc="X.org misc fonts"
arch=(any)
url="http://xorg.freedesktop.org/"
license=('custom')
depends=(xorg-fonts-encodings xorg-fonts-alias xorg-font-utils fontconfig)
install=xfonts.install
source=(${url}/releases/individual/font/font-arabic-misc-${pkgver}.tar.bz2
        ${url}/releases/individual/font/font-cursor-misc-${pkgver}.tar.bz2
        ${url}/releases/individual/font/font-daewoo-misc-${pkgver}.tar.bz2
        ${url}/releases/individual/font/font-dec-misc-${pkgver}.tar.bz2
        ${url}/releases/individual/font/font-isas-misc-${pkgver}.tar.bz2
        ${url}/releases/individual/font/font-jis-misc-${pkgver}.tar.bz2
        ${url}/releases/individual/font/font-micro-misc-${pkgver}.tar.bz2
        ${url}/releases/individual/font/font-misc-misc-1.1.0.tar.bz2
        ${url}/releases/individual/font/font-mutt-misc-${pkgver}.tar.bz2
        ${url}/releases/individual/font/font-schumacher-misc-1.1.0.tar.bz2
        ${url}/releases/individual/font/font-sony-misc-${pkgver}.tar.bz2
        ${url}/releases/individual/font/font-sun-misc-${pkgver}.tar.bz2)
md5sums=('817ceb99636c873ad7679fe2a468678d'
         '13c21c4d74155c662152a1a74f249d96'
         '05597e2b193a7b7de2ca525468276b1d'
         '05714516824c680ce747c6ef9d2fbbdd'
         '88b5b32c5a27576e9d00675bcc966806'
         '5835c99d056f4a29d7d6a5ae873cf00e'
         '6350117efebe340f33e818f4a33e4e4b'
         '878bfd4e9f14c1279cea3a8392e0dbdd'
         'aab7ac62b960e77aa11d032bafe1d460'
         '86f4b7d8b11a2e6da70884c59b5866a3'
         '7b6f5117814599b86ed3470de6c62aa3'
         '5a185c5549a650bf062d343e128682ca')

build() {
  cd "${srcdir}"
  for dir in *; do
    if [ -d "${dir}" ]; then
      pushd "${dir}"
      ./configure --prefix=/usr \
          --with-fontdir=/usr/share/fonts/misc
      make
      popd
    fi
  done
}

package() {
  cd "${srcdir}"
  install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
  for dir in *; do
    if [ -d "${dir}" ]; then
      pushd "${dir}"
      make DESTDIR="${pkgdir}" install
      install -m644 COPYING ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.${dir%-*}
      popd
    fi
  done
  rm -f ${pkgdir}/usr/share/fonts/*/fonts.*
}